AgreeInfoGridCtl = Ext.extend(GridCtl, {

			getCmItems : function() {

				var items = [this.getCmItem('编号', 'id', true),
						this.getCmItem('createtime', 'createtime', false),
						this.getCmItem('userid', 'userid', false),
						this.getCmItem('状态', 'statusStr', true),
						this.getCmItem('类型', 'typeStr', true),
						this.getCmItem('协议单名称', 'proname', true),
						this.getCmItem('客户公司名称', 'customername', true),
						this.getCmItem('customerid', 'customerid', false),
						this.getCmItem('客户联系人', 'connectername', true),
						this.getCmItem('根协议单编号', 'rootid', true),
						this.getCmItem('项目区域', 'region', true),
						this.getCmItem('项目国家', 'country', true),
						this.getCmItem('项目城市', 'city', true),
						this.getCmItem('项目规模', 'size', true),
						this.getCmItem('签单币种', 'currency', true),
						this.getCmItem('签单日期 ', 'signdate', true),
						this.getCmItem('资料提供日期', 'dataRdyTime', true),
						this.getCmItem('完成日期', 'finishTime', true),
						this.getCmItem('销售员', 'userName', true),
						this.getCmItem('合同总金额本币', 'cost', true),
						this.getCmItem('合同总金额人民币', 'costRmb', true),
						this.getCmItem('制作具体要求', 'requirements', true)];
				return items;
			},
			getCommonConfig : function() {

				var config = {
					region : 'center'
				};

				return config;

			},
			configBbarItems : function(config) {

				return config;

			},
			getStoreUrl : function() {

				var resource = 'contract.do';
				var server = cf.getC('s');
				var url = server.getUrl({
							resource : resource,
							act : 'select'
						});
				return url;
			},
			getRecord : function(index) {
				var store = this.store;
				return store.getAt(index);
			},
			getSelectedRecord : function() {
				var sm = this.cmp.getSelectionModel();
				return sm.getSelected();
			},
			configButtons : function(config) {
				
//				contractmgr_del
//				contractmgr_addplus
//				contractmgr_add
//				contractmgr_showdetail

				var buttons = [{
							text : '添加协议单',
							handler : this.add,
							scope : this
						}, {
							text : '添加修正单',
							handler : this.edit,
							scope : this
						}
//						, {
//							text : '删除',
//							handler : this.del,
//							scope : this
//						}
						, {
							text : '详细信息',
							handler : this.showDetail,
							scope : this
						}];

				config.buttonAlign = 'left';
				config.buttons = buttons;

				return config;

			},
			add : function() {

				var aawc = cf.getC('aawc');
				aawc.show();

			},
			edit : function() {

				var record = this.getSelectedRecord();
				if (!record) {
					alert('请先选择一条记录！');
					return;
				}
				var aapwc = cf.getC('aapwc');
				aapwc.show(record.get('id'));
			},
			del : function() {

				var uawc = cf.getC('uawc');
				var uafc = cf.getC('uafc');
				var recordList = this.getSelectList();
				if (!recordList) {
					alert('请先选择一条记录！');
					return;
				}
				var idList = this.getSelectIdList(recordList);

				var s = cf.getC('s');

				var para = {
					resource : 'user.do',
					act : 'd',
					params : {
						idList : Ext.encode(idList)
					},
					cbf : this.delSuccess,
					scope : this
				};
				s.request(para);

			},
			delSuccess : function(response) {
				var cigc = cf.getC('usrmger');
				cigc.reload();
			},
			showDetail : function() {

				var record = this.getSelectedRecord();
				if (!record) {
					alert('请先选择一条记录！');
					return;
				}

				var cswc = cf.getC('aswc');
				cswc.show(record.get('id'));
			}

		});
